﻿using FirstFloor.ModernUI.App.Pages.items;
using FirstFloor.ModernUI.Windows.Controls;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace FirstFloor.ModernUI.App.Pages.items
{
    /// <summary>
    /// Interaction logic for EditDeleteItem.xaml
    /// </summary>
    /// (http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid.aspx)
    /// 
   // public enum OrderStatus { None, New, Processing, Shipped, Received };
    public class Customer
    {
        public string ProductName { get; set; }
        public string ComName { get; set; }
        public string ManCompany { get; set; }
        public int Barcode { get; set; }
      //  public OrderStatus Status { get; set; }
    }


    public partial class EditDeleteItem : UserControl
    {
        public EditDeleteItem()
        {
            InitializeComponent();

            ObservableCollection<Customer> custdata = GetData();

            //Bind the DataGrid to the customer data
            DG1.DataContext = custdata;
           

            
        }
      private ObservableCollection<Customer> GetData()
        {
            var customers = new ObservableCollection<Customer>();
            customers.Add(new Customer { ProductName = "Paramol", ComName = "pandol", ManCompany = "orlando", Barcode = 4454454});
            customers.Add(new Customer { ProductName = "test", ComName = "pandol", ManCompany = "orlando", Barcode = 4454454 });
            

            return customers;
        }

      private void DG1_SelectionChanged(object sender, SelectionChangedEventArgs e)
      {
          if (DG1.SelectedItems != null)
          {
              var wnd = new ModernWindow
              {
                  Style = (Style)App.Current.Resources["EmptyWindow"],
                  Content = new EditDeleteItemCont
                  {
                      Margin = new Thickness(32)
                  },
                  Width = 400,
                  Height = 350
              };
              wnd.WindowStartupLocation = WindowStartupLocation.CenterScreen;
              wnd.Topmost = true;

              wnd.ShowDialog();
          }
      }

    
    }

}
